package edu.sctu.practice.class02.shilaihong.assign08.two;

import java.awt.*;
import java.io.*;
import java.net.Socket;

/**
 * Created by admin on 2015/12/22.
 */
public class ServerThread extends Thread
{  Socket socket;
    ObjectInputStream in=null;
    ObjectOutputStream out=null;
    String s =null;

    ServerThread(Socket t)
    {  socket=t;
        try  { out=new ObjectOutputStream(socket.getOutputStream()); //socket返回输出流。
            in=new ObjectInputStream(socket.getInputStream()); //socket返回输入流。
        }
        catch (IOException e)
        {}
    }

    public void run()
    {  TextArea text=new TextArea("你好,我是服务器",12,12);
        try{  out.writeObject(text);
        }
        catch (IOException e)
        {   System.out.println("客户离开");
        }
    }
}


